﻿using System.Collections.Generic;
using UIAuth.Common;

namespace UIAuth.Examples.ExampleBL
{
    internal class AuthProvider : IAuthLevelProvider
    {
        private readonly Dictionary<string, AuthLevel> Profile = new Dictionary<string, AuthLevel>();

        public AuthProvider()
        {
            Profile.Add("readonly", AuthLevel.ReadOnly);
            Profile.Add("invisible", AuthLevel.Invisible);
            Profile.Add("entireVM", AuthLevel.ReadOnly);
        }

        #region IAuthLevelProvider Members

        public AuthLevel GetAuthLevel(string securityName)
        {
            if (Profile.ContainsKey(securityName))
                return Profile[securityName];
            return AuthLevel.Unknown;
        }

        #endregion
    }
}